#include<iostream>
#include<algorithm>
using namespace std;
typedef long long LL;
const int N = 1e5 + 10;
LL arr[N];
LL d[N];
int n;
int main()
{
	cin >> n;
	for (int i = 1; i <= n; i++) {
		cin >> arr[i];
		d[i] = arr[i] - arr[i - 1];
		//cout<<d[i]<<" ";
	}
	//cout<<endl;
	LL p = 0, q = 0;
	for (int i = 2; i <= n; i++) {
		if (d[i] > 0)p += d[i];
		else q -= d[i];
	}
	cout << max(q, p) << endl;
	cout << abs(p - q) + 1 << endl;
	return 0;
}